home *** CD-ROM | disk | FTP | other *** search
- ; ***************************************************************************
- ; LANCTL.ASM - More Assembly language functions for LANtastic
- ; 8/31/89 JEM
- ; 2/18/91 JEM Updated for MASM 5.1
- ; ***************************************************************************
- .MODEL COMPACT,C
- .CODE
-
- time_block struc
- TB_year dw ? ; Year
- TB_day db ? ; Day of month (1-31)
- TB_month db ? ; Month (1-12)
- TB_minutes db ? ; Minutes (0-59)
- TB_hour db ? ; Hour (0-23)
- TB_hundreths db ? ; Hundreths of seconds (0-99)
- TB_seconds db ? ; Seconds (0-59)
- time_block ends
-
- ;
- ; Name: get_message
- ; Function: Gets the last unsolicited network message. Returns 0
- ; if successful, error code otherwise.
- ; Caller: MS C compact model
- ; Args: get_message(buffer);
- ; far char *buffer;
- ; Author: JEM
- ; Date: 8/18/89
- ;
- get_message PROC NEAR USES ES DI DS SI, buffer:PTR
-
- ; Call LANOS get message function
- les di,buffer
- mov ax,5F99H
- int 21H
-
- ; process the result
- jc GLM_DONE ; if CS, we have a problem
- xor ax,ax ; else, return 0
-
- ; we're done -- clean up and go home
- GLM_DONE:
- ret
- get_message ENDP
-
- ;
- ; Name: lpt_timeout
- ; Function: Sets the network printer timeout, in seconds
- ; Caller: MSC 4.0, Compact
- ; Args: lpt_timeout(seconds);
- ; int seconds;
- ; Author: JM
- ; Date: 8/31/89
- lpt_timeout PROC NEAR USES ES DI DS SI, seconds:WORD
-
- mov ax,seconds ; load time in seconds
- mov cx,18 ; * 18.2 ticks/second
- mul cx ; convert to clock ticks
- mov cx,ax ; store in CX
- mov ax,5FD1h ; Set timeout fn
- int 21h ; Set the timeout
- ret
- lpt_timeout ENDP
-
-
- ;
- ; Name: set_clock
- ; Function: Sets a station's time from the specified server
- ; Caller: MSC 4.0, Compact
- ; Args: set_clock(server)
- ; char *server;
- ; Author: JM
- ; Date:
-
- set_clock PROC NEAR USES ES DI DS SI, server:PTR
- LOCAL tb[4]:WORD
-
- les di,server ; ES:DI points to server name
-
- mov si,ss
- mov ds,si
- mov si, bp
- sub si, 8 ; DS:SI points to time block
-
- mov ax,5FC0h ; Get server time fcn.
- int 21h ; get the server's time stamp
-
- ; Set the station's date
- mov ah,2Bh ; set date fn
- mov cx,[si].TB_year
- mov dh,[si].TB_month
- mov dl,[si].TB_day
- int 21h ; Set the date
-
- ; Set the station's time
- mov ah,2Dh ; set time fn.
- mov ch,[si].TB_hour
- mov cl,[si].TB_minutes
- mov dh,[si].TB_seconds
- mov dl,[si].TB_hundreths
- int 21h ; Set the time
- ret
- set_clock ENDP
-
- ;
- ; Name: set_lpt_mode
- ; Function:
- ; Caller: MSC 4.0, Compact
- ; Args: set_lpt_mode(mode)
- ;
- ; Author: JM
- ; Date:
- set_lpt_mode PROC NEAR USES ES DI DS SI, mode:WORD
- mov dl,byte ptr (mode) ; 0 = combined, 1 = separate
- mov ax,5D08h ; set prt mode fn
- int 21h ; do it!
- ret
- set_lpt_mode ENDP
-
- ;
- ; Name: flush_lpt
- ; Function:
- ; Caller: MSC 4.0, Compact
- ; Args: flush_lpt()
- ;
- ; Author: JM
- ; Date:
- flush_lpt PROC NEAR USES ES DI DS SI
- mov ax,5D09h ; flush printer function
- int 21h
- ret
- flush_lpt ENDP
-
- ;
- ; Name: queue_ctl
- ; Function:
- ; Caller: MSC 4.0, Compact
- ; Args: queue_ctl(command,server)
- ;
- ; Author: JM
- ; Date:
- queue_ctl PROC NEAR USES ES DI DS SI, command:WORD, server:PTR
- mov bl,byte ptr (command)
- les di,server
- mov ax,5FA2h
- int 21h
- ret
- queue_ctl ENDP
-
- ;
- ; Name: audit
- ; Function: Create user audit file entry
- ; Caller: MSC 4.0, Compact
- ; Args: audit(server,reason,entry)
- ; char *server,*reason,*entry;
- ; Author: JM
- ; Date:
- audit PROC NEAR USES ES DI DS SI, server:PTR, reason:PTR, entry:PTR
- les di,server
- lds dx,reason
- lds si,entry
- mov ax,5FA7h ; create user audit entry
- int 21h
- ret
- audit ENDP
- END
-